package com.cmb;

import java.util.HashMap;

public class Product {
    private final String name;

    public void setSellIn(int sellIn) {
        this.sellIn = sellIn;
    }

    private int sellIn;
    private int quality;

    public Product(String name, int sellIn, int quality) {
        this.name = name;
        this.sellIn = sellIn;
        this.quality = quality;
    }

    public int getSellIn() {
        return this.sellIn;
    }

    public int getQuality() {
        return this.quality;
    }

    public void setQuality(int quality) {
        this.quality = quality;
    }

    public String getName() {
        return this.name;
    }

    void updateBackstagePass() {
        setQuality(++this.quality);
        setSellIn(--this.sellIn);
    }

    void updateAgedBrie() {
        if (++this.quality > 50) {
            setQuality(50);
        } else {
            setQuality(++this.quality);
        }
        setSellIn(--this.sellIn);
    }

    void updateDefaultProduct() {
        if (this.sellIn == 0) {
            setQuality(Math.max(this.quality - 2, 0));
        } else {
            setQuality(Math.max(this.quality - 1, 0));
            setSellIn(--this.sellIn);
        }
    }

    public void update() {

    }
}
